const CHANGE_USER = 'CHANGE_USER'
const state = { user: null }

const getters = {
  getUser(state) {
    return state.user
  }
}

const mutations = {
  CHANGE_USER(state, data) {
    state.user = data
  }
}

const actions = {
  changeUser({ commit }, data) {
    commit(CHANGE_USER, data)
  }
}

export default {
  namespaced: true,
  state,
  getters,
  mutations,
  actions
}
